package com.lmk.system.listener;

import com.lmk.system.service.IPermissionScanService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;

import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;
import javax.servlet.annotation.WebListener;

// ServletContextListener上下文监听器
@WebListener
@Slf4j
public class PermissionScanInitListener implements ServletContextListener {
    @Autowired
    private IPermissionScanService scanService;
    @Override
    public void contextInitialized(ServletContextEvent sce) {

                System.out.println("==========权限注解扫描开始==========");
                //扫描包-扫描类-扫描接口-扫描注解-解析注解-
                // 获取注解上参数:name ,sn【自定义注解上】 ,url【xxxmapper注解上】
                scanService.scanPermission();
                System.out.println("==========权限注解扫描结束==========");


    }

}
